<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no">
	<title>日新网_我的问答</title>
	<link rel="stylesheet" href="__TMPL__Public/assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/reset.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/style.css">
	<script type="text/javascript" src="__TMPL__Public/assets/js/rem.js"></script>
	<style>
		.tab_nav li {
			width: 25%!important;
			text-align: center;
		}
		.hidden {
			display: none;
		}
		body {
			background-color: #fff!important;
		}

	</style>
</head>
<body>
<!--nav-->
<tc_include file="Public:nav"/>
<!--我的问答页-->
<div class="tab_nav " id="tab_nav">
	<ul class="comWidth clearfix index_ul">
		<li>提问(<span>{$count_list[0]}</span>)</li>
		<li>回答(<span>{$count_list[1]}</span>)</li>
		<li>查看(<span>{$count_list[2]}</span>)</li>
		<li>新消息(<span>{$count_list[3]}</span>)</li>
	</ul>
</div>
<div id="tab_content">

	<!--提问-->
	<div class="tab_content comWidth index_content hidden">
		<volist name="lists" id="vo">
			<a href="{:U('Question/Question/question_info', ['id' => $vo['id']])}">
				<div class="questions_item ">
					<p class="text1 ellipsis2">{$vo.post_title}</p>
					<p class="text2">
						<span>{$vo.post_date}</span>
						<span>浏览(<i>{$vo.post_hits}</i>)</span>
						<span>回答(<i>{$vo.answer_count}</i>)</span>
						<!--<i class="login_wx"></i>-->
					</p>
				</div>
			</a>
		</volist>
		<if condition="empty($lists)">
			<div style="width: 5rem;height: 3.8rem;position: absolute;top: 50%;left: 50%;margin-top: -1.9rem;margin-left: -2.5rem;">
				<img src="/public/images/img/replace.png" alt="" style="width: 100%;height: auto;">
			</div>
		</if>
	</div>

	<!--回答-->
	<div class="news comWidth index_content hidden">
		<volist name="lists" id="vo">
			<a href="{:U('Question/Question/question_info', ['id' => $vo['id']])}">
				<div class="questions_item ">
					<p class="text1 ellipsis2">{$vo.post_title}</p>
					<p class="text2">
						<span>{$vo.post_date}</span>
						<span>浏览(<i>{$vo.post_hits}</i>)</span>
						<span>回答(<i>{$vo.answer_count}</i>)</span>
						<!--<i class="login_wx"></i>-->
					</p>
				</div>
			</a>
		</volist>
		<if condition="empty($lists)">
			<div style="width: 5rem;height: 3.8rem;position: absolute;top: 50%;left: 50%;margin-top: -1.9rem;margin-left: -2.5rem;">
				<img src="/public/images/img/replace.png" alt="" style="width: 100%;height: auto;">
			</div>
		</if>
	</div>

	<!--查看-->
	<div class="tab_content comWidth index_content hidden">
		<volist name="lists" id="vo">
			<a href="{:U('Question/Question/question_info', ['id' => $vo['id']])}">
				<div class="questions_item ">
					<p class="text1 ellipsis2">{$vo.post_title}</p>
					<p class="text2">
						<span>{$vo.post_date}</span>
						<span>浏览(<i>{$vo.post_hits}</i>)</span>
						<span>回答(<i>{$vo.answer_count}</i>)</span>
						<!--<i class="login_wx"></i>-->
					</p>
				</div>
			</a>
		</volist>
		<if condition="empty($lists)">
			<div style="width: 5rem;height: 3.8rem;position: absolute;top: 50%;left: 50%;margin-top: -1.9rem;margin-left: -2.5rem;">
				<img src="/public/images/img/replace.png" alt="" style="width: 100%;height: auto;">
			</div>
		</if>
	</div>

	<!--新消息-->
	<div class="tab_content comWidth index_content hidden">
		<volist name="lists" id="vo">
			<a href="{$vo.url}&msg_id={$vo.id}">
				<div class="tips_item ">
					<p class="text1">
						<span>{$vo.content}</span>
					</p>
					<p class="ellipsis1 text3">{$vo.post_title}</p>
					<p class="text3">{$vo.time}</p>
				</div>
			</a>
		</volist>
		<if condition="empty($lists)">
			<div style="width: 5rem;height: 3.8rem;position: absolute;top: 50%;left: 50%;margin-top: -1.9rem;margin-left: -2.5rem;">
				<img src="/public/images/img/replace.png" alt="" style="width: 100%;height: auto;">
			</div>
		</if>
	</div>

	<div style="height: .5rem;line-height: .5rem;background-color: #efdddd;" class="js-infinite-scroll-loading text-center">更多</div>
	<div id="nextpage"></div>
</div>

<!--页脚-->
<tc_include file="Public:footer"/>

<script type="text/javascript" src="__TMPL__Public/assets/js/jquery.1.12.4.js"></script>
<script src="__TMPL__Public/assets/js/bootstrap.min.js" ></script>
<script src="__TMPL__Public/assets/js/jquery.infiniteScroll.js"></script>
<script>
	$(function () {

		var index = "{$list_index}";

		// 显示内容
		$('.index_content:eq(' + index + ')').removeClass('hidden');

		// 切换tab
		$(".index_ul li").on("click", function(){
			var index = $(this).index();
			window.location.href = "{:U('Question/Question/center_question')}" + '&list_index=' + index;
		});

		// tab显示背景
		$('.index_ul li:eq(' + index + ')').addClass('active');


		// 加载更多
		$('#nextpage').infiniteScroll({
			loading:'.js-infinite-scroll-loading',
			total_pages:{$total_page},
			success:function(content){
				var $items = $(content).find('.index_content:eq(' + index + ') a');
				if ($items.length > 0) {
					$('.index_content:eq(' + index + ')').append($items);
				}
			}
		});
	})
</script>
</body>
</html>